#pragma once

#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <DbgHelp.h>

int CustomLevelFilter( int code, struct _EXCEPTION_POINTERS *pExceptionInfo );
LONG WINAPI TopLevelFilter( struct _EXCEPTION_POINTERS *pExceptionInfo );
LONG WINAPI DumpException(_EXCEPTION_POINTERS* pExceptionInfo = NULL);
LONG WINAPI UnknowExceptionHandler( _EXCEPTION_POINTERS* pExceptionInfo );
void WriteStackDetails(	PCONTEXT pContext, bool bWriteVariables );
BOOL GetLogicalAddress( PVOID addr, char* szModule, DWORD len, DWORD& section, DWORD& offset );
char* GetExceptionString( DWORD dwCode );
void PureCallHandler();
void InvalidParameterHandler(const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t pReserved);
void WINAPI InitDbg();

#define DUMPCRASH_BEGIN			SetUnhandledExceptionFilter(TopLevelFilter); InitDbg();
